using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using SourceStack.Repositories;
using E = SourceStack.Entities;


namespace SourceStack.Pages.Suggest
{
    public class IndexModel : PageModel
    {
        private SuggestRepository suggestRepository;
        public IndexModel()
        {
            suggestRepository = new SuggestRepository();
        }
        public IList<E.Suggest> Suggests { get; set; }
        public void OnGet()
        {
            int pageIndex = Convert.ToInt32(Request.Query["pageIndex"][0]);
            Suggests = suggestRepository.Get(pageIndex,  8);
            ViewData["Count"] = suggestRepository.GetCount();
        }
    }
}
